scoreboard objectives add dayshower_trigger_day dummy
scoreboard objectives add dayshower_day dummy
scoreboard objectives add dayshower_show_day dummy
scoreboard objectives add dayshower_title dummy
scoreboard objectives add dayshower_actionbar dummy
scoreboard objectives add dayshower_tellraw dummy
scoreboard objectives add dayshower_sounds dummy
scoreboard objectives add dayshower_word_check dummy
scoreboard objectives add dayshower_flash dummy
scoreboard objectives add dayshower_settings trigger
scoreboard objectives add dayshower_leap_year dummy
scoreboard objectives add dayshower_format dummy
scoreboard objectives add dayshower_year dummy
scoreboard objectives add dayshower_leap_today dummy
scoreboard objectives add dayshower_month dummy
scoreboard objectives add dayshower_always_show dummy
scoreboard objectives add dayshower_storge_1 dummy
scoreboard objectives add dayshower_storge_2 dummy
scoreboard objectives add dayshower_storge_3 dummy
scoreboard objectives add dayshower_pages dummy
scoreboard objectives add dayshower_advertisments dummy
scoreboard objectives add dayshower_particles dummy
scoreboard objectives add dayshower_sound_style dummy
scoreboard objectives add dayshower_last_sounds dummy
scoreboard objectives add dayshower_animation_obfuscated dummy
execute as @a run scoreboard players enable @s dayshower_settings

execute as @a unless score @s dayshower_actionbar = @s dayshower_actionbar run scoreboard players set @s dayshower_actionbar 1
execute as @a unless score @s dayshower_title = @s dayshower_title run scoreboard players set @s dayshower_title 0
execute as @a unless score @s dayshower_tellraw = @s dayshower_tellraw run scoreboard players set @s dayshower_tellraw 1
execute as @a unless score @s dayshower_sounds = @s dayshower_sounds run scoreboard players set @s dayshower_sounds 1
execute as @a unless score @s dayshower_word_check = @s dayshower_word_check run scoreboard players set @s dayshower_word_check 1
execute as @a unless score @s dayshower_flash = @s dayshower_flash run scoreboard players set @s dayshower_flash 1
execute as @a unless score @s dayshower_settings = @s dayshower_settings run scoreboard players set @s dayshower_settings 1
execute as @a unless score @s dayshower_format = @s dayshower_format run scoreboard players set @s dayshower_format 0
execute as @a unless score @s dayshower_pages = @s dayshower_pages run scoreboard players set @s dayshower_pages 1
execute as @a unless score @s dayshower_always_show = @s dayshower_always_show run scoreboard players set @s dayshower_always_show 0
execute as @a unless score @s dayshower_particles = @s dayshower_particles run scoreboard players set @s dayshower_particles 0
execute as @a unless score @s dayshower_sound_style = @s dayshower_sound_style run scoreboard players set @s dayshower_sound_style 1
execute as @a unless score @s dayshower_last_sounds = @s dayshower_last_sounds run scoreboard players set @s dayshower_last_sounds 1
execute as @a unless score @s dayshower_animation_obfuscated = @s dayshower_animation_obfuscated run scoreboard players set @s dayshower_animation_obfuscated 0
execute as @a unless score @s dayshower_advertisments = @s dayshower_advertisments run function dayshower:system/rewards

execute as @a if score @s dayshower_settings matches 1 run function dayshower:settings/player_settings
execute as @a if score @s dayshower_settings matches 2 run function dayshower:settings/seeing_seetings
execute as @a if score @s dayshower_settings matches 3 run function dayshower:settings/animation_settings
execute as @a if score @s dayshower_settings matches 4 run function dayshower:settings/sound_settings
execute as @a if score @s dayshower_settings matches 2..4 run scoreboard players set @s dayshower_pages 1

execute as @a store result score @s dayshower_day run time query day
execute as @a unless score @s dayshower_day = @s dayshower_trigger_day run tag @s add dayshower_show_day
execute as @a if score @s dayshower_settings matches 10 run tag @s add dayshower_show_day
execute as @a[tag=dayshower_show_day] run scoreboard players operation @s dayshower_trigger_day = @s dayshower_day
execute as @a[tag=dayshower_show_day] run scoreboard players set @s dayshower_show_day 0
execute as @a[tag=dayshower_show_day] if score @s dayshower_particles matches 1 at @s run particle end_rod ~ ~ ~ 0.125 0.125 0.125 0.7 500 normal @s
execute if entity @a[tag=dayshower_show_day,scores={dayshower_format=1}] run function dayshower:settings/day_format
execute as @a[tag=dayshower_show_day] run function dayshower:system/show_day

execute as @a unless score @s dayshower_word_check matches 0..1 run scoreboard players set @s dayshower_word_check 1
execute as @a if score @s dayshower_settings matches -100 run scoreboard players set @s dayshower_actionbar 1
execute as @a if score @s dayshower_settings matches -101 run scoreboard players set @s dayshower_actionbar 0
execute as @a if score @s dayshower_settings matches -102 run scoreboard players set @s dayshower_title 1
execute as @a if score @s dayshower_settings matches -103 run scoreboard players set @s dayshower_title 0
execute as @a if score @s dayshower_settings matches -104 run scoreboard players set @s dayshower_tellraw 1
execute as @a if score @s dayshower_settings matches -105 run scoreboard players set @s dayshower_tellraw 0
execute as @a if score @s dayshower_settings matches -106 run scoreboard players set @s dayshower_format 1
execute as @a if score @s dayshower_settings matches -107 run scoreboard players set @s dayshower_format 0
execute as @a if score @s dayshower_settings matches -108 run scoreboard players set @s dayshower_pages 2
execute as @a if score @s dayshower_settings matches -108 run trigger dayshower_settings set 2
execute as @a if score @s dayshower_settings matches -109 run scoreboard players set @s dayshower_pages 1
execute as @a if score @s dayshower_settings matches -109 run trigger dayshower_settings set 2
execute as @a if score @s dayshower_settings matches -110 run scoreboard players set @s dayshower_always_show 1
execute as @a if score @s dayshower_settings matches -111 run scoreboard players set @s dayshower_always_show 0
execute as @a if score @s dayshower_settings matches -112 run scoreboard players set @s dayshower_particles 1
execute as @a if score @s dayshower_settings matches -113 run scoreboard players set @s dayshower_particles 0
execute as @a if score @s dayshower_settings matches -113..-100 run scoreboard players set @s dayshower_settings 0

execute as @a if score @s dayshower_settings matches -200 run scoreboard players set @s dayshower_flash 1
execute as @a if score @s dayshower_settings matches -201 run scoreboard players set @s dayshower_flash 0
execute as @a if score @s dayshower_settings matches -202 run scoreboard players set @s dayshower_animation_obfuscated 1
execute as @a if score @s dayshower_settings matches -203 run scoreboard players set @s dayshower_animation_obfuscated 0
execute as @a if score @s dayshower_settings matches -203..-200 run scoreboard players set @s dayshower_settings 0

execute as @a if score @s dayshower_settings matches -300 run scoreboard players set @s dayshower_sounds 1
execute as @a if score @s dayshower_settings matches -301 run scoreboard players set @s dayshower_sounds 0
execute as @a if score @s dayshower_settings matches -302 run scoreboard players set @s dayshower_sound_style 1
execute as @a if score @s dayshower_settings matches -303 run scoreboard players set @s dayshower_sound_style 2
execute as @a if score @s dayshower_settings matches -304 run scoreboard players set @s dayshower_last_sounds 1
execute as @a if score @s dayshower_settings matches -305 run scoreboard players set @s dayshower_last_sounds 0
execute as @a if score @s dayshower_settings matches -303..-300 run scoreboard players set @s dayshower_settings 0

execute as @a if score @s dayshower_always_show matches 1 if score @s dayshower_title matches 1 if score @s dayshower_format matches 1 run title @s title [{"text": "--"},{"score":{"name": "*","objective": "dayshower_year"}},{"translate":"年"},{"score":{"name": "*","objective": "dayshower_month"}},{"translate":"月"},{"score":{"name": "*","objective": "dayshower_storge_2"}},{"translate":"日"},{"text": "--"}]
execute as @a if score @s dayshower_always_show matches 1 if score @s dayshower_actionbar matches 1 if score @s dayshower_format matches 1 run title @s actionbar [{"text": "--"},{"score":{"name": "*","objective": "dayshower_year"}},{"translate":"年"},{"score":{"name": "*","objective": "dayshower_month"}},{"translate":"月"},{"score":{"name": "*","objective": "dayshower_storge_2"}},{"translate":"日"},{"text": "--"}]
execute as @a if score @s dayshower_always_show matches 1 if score @s dayshower_title matches 1 if score @s dayshower_format matches 0 run title @s title [{"text": "--"},{"translate":"第"},{"score":{"name": "*","objective": "dayshower_day"}},{"translate":"天"},{"text": "--"}]
execute as @a if score @s dayshower_always_show matches 1 if score @s dayshower_actionbar matches 1 if score @s dayshower_format matches 0 run title @s actionbar [{"text": "--"},{"translate":"第"},{"score":{"name": "*","objective": "dayshower_day"}},{"translate":"天"},{"text": "--"}]